cap cd "C:\Users\ejm5\Dropbox\PAPI conjoint\Replication"
cap cd "/Users/paulschuler/Dropbox/projects/PAPI conjoint\Replication"
use PAPI_Conjoint_3years.dta, clear
set more off
 
tab year
lab var party "Party Member"

mvdecode d101* d305* vote, mv(888=.b\999=.c)


#delimit;
label values a011 perform;
label define perform 0 "Very Bad" 1 "Bad" 2 "Neutral" 3"Good" 4"Very Good";

#delimit;
generate treatment_experience=1 if vote_exp !=.;
replace treatment_experience=0 if vote_exp ==.;




#delimit;
tab d102_1;
tab d102_1_ot;
split d102_1_ot, generate(r_) parse("") limit(15);

#delimit;
generate d102_party=1 if r_1=="dang"|r_1=="Dang"|r_2=="dang"|r_2=="Dang"|r_3=="dang"|r_3=="Dang"|r_4=="dang"|r_4=="Dang"|r_5=="dang"|r_5=="Dang"|
r_6=="dang"|r_6=="Dang"|r_7=="dang"|r_7=="Dang"|r_8=="dang"|r_8=="Dang"|r_9=="dang"|r_9=="Dang"|r_10=="dang"|r_10=="Dang"|
r_11=="dang"|r_11=="Dang"|r_12=="dang"|r_12=="Dang"|r_13=="dang"|r_13=="Dang"|r_14=="dang"|r_14=="Dang"|r_15=="dang"|r_15=="Dang";
replace d102_party=1 if r_1=="đang"|r_1=="Đang"|r_2=="đang"|r_2=="Đang"|r_3=="đang"|r_3=="Đang"|r_4=="đang"|r_4=="Đang"|r_5=="đang"|r_5=="Đang"|
r_6=="đang"|r_6=="Đang"|r_7=="đang"|r_7=="Đang"|r_8=="đang"|r_8=="Đang"|r_9=="đang"|r_9=="Đang"|r_10=="đang"|r_10=="Đang"|
r_11=="đang"|r_11=="Đang"|r_12=="đang"|r_12=="Đang"|r_13=="đang"|r_13=="Đang"|r_14=="đang"|r_14=="Đang"|r_15=="đang"|r_15=="Đang";
replace d102_party=1 if r_1=="đang"|r_1=="Đảng"|r_2=="đang"|r_2=="Đảng"|r_3=="đang"|r_3=="Đảng"|r_4=="đang"|r_4=="Đảng"|r_5=="đang"|r_5=="Đảng"|
r_6=="đang"|r_6=="Đảng"|r_7=="đang"|r_7=="Đảng"|r_8=="đang"|r_8=="Đảng"|r_9=="đang"|r_9=="Đảng"|r_10=="đang"|r_10=="Đảng"|
r_11=="đang"|r_11=="Đảng"|r_12=="đang"|r_12=="Đảng"|r_13=="đang"|r_13=="Đảng"|r_14=="đang"|r_14=="Đảng"|r_15=="đang"|r_15=="Đảng";
replace d102_party=0 if d102_party==.;
lab var d102_party "They are a pary member";

#delimit;
generate d102_youth=1 if r_1=="tre"|r_1=="tuoi"|r_2=="tre"|r_2=="tuoi"|r_3=="tre"|r_3=="tuoi"|r_4=="tre"|r_4=="tuoi"|r_5=="tre"|r_5=="tuoi"|
r_6=="tre"|r_6=="tuoi"|r_7=="tre"|r_7=="tuoi"|r_8=="tre"|r_8=="tuoi"|r_9=="tre"|r_9=="tuoi"|r_10=="tre"|r_10=="tuoi"|
r_11=="tre"|r_11=="tuoi"|r_12=="tre"|r_12=="tuoi"|r_13=="tre"|r_13=="tuoi"|r_14=="tre"|r_14=="tuoi"|r_15=="tre"|r_15=="tuoi";

replace d102_youth=1 if r_1=="Tre"|r_1=="Tuoi"|r_2=="Tre"|r_2=="Tuoi"|r_3=="Tre"|r_3=="Tuoi"|r_4=="Tre"|r_4=="Tuoi"|r_5=="Tre"|r_5=="Tuoi"|
r_6=="Tre"|r_6=="Tuoi"|r_7=="Tre"|r_7=="Tuoi"|r_8=="Tre"|r_8=="Tuoi"|r_9=="Tre"|r_9=="Tuoi"|r_10=="Tre"|r_10=="Tuoi"|
r_11=="Tre,"|r_11=="Tuoi"|r_12=="Tre,"|r_12=="Tuoi"|r_13=="Tre,"|r_13=="Tuoi"|r_14=="Tre,"|r_14=="Tuoi"|r_15=="Tre,"|r_15=="Tuoi";

replace d102_youth=1 if r_1=="Tre,"|r_1=="Tuoi"|r_2=="Tre,"|r_2=="Tuoi"|r_3=="Tre,"|r_3=="Tuoi"|r_4=="Tre,"|r_4=="Tuoi"|r_5=="Tre,"|r_5=="Tuoi"|
r_6=="Tre,"|r_6=="Tuoi"|r_7=="Tre,"|r_7=="Tuoi"|r_8=="Tre,"|r_8=="Tuoi"|r_9=="Tre,"|r_9=="Tuoi"|r_10=="Tre,"|r_10=="Tuoi"|
r_11=="Tre,"|r_11=="Tuoi"|r_12=="Tre,"|r_12=="Tuoi"|r_13=="Tre,"|r_13=="Tuoi"|r_14=="Tre,"|r_14=="Tuoi"|r_15=="Tre,"|r_15=="Tuoi";

replace d102_youth=1 if r_1=="Trẻ"|r_1=="Tuổi"|r_2=="Trẻ"|r_2=="Tuổi"|r_3=="Trẻ"|r_3=="Tuổi"|r_4=="Trẻ"|r_4=="Tuổi"|r_5=="Trẻ"|r_5=="Tuổi"|
r_6=="Trẻ"|r_6=="Tuổi"|r_7=="Trẻ"|r_7=="Tuổi"|r_8=="Trẻ"|r_8=="Tuổi"|r_9=="Trẻ"|r_9=="Tuổi"|r_10=="Trẻ"|r_10=="Tuổi"|
r_11=="Trẻ"|r_11=="Tuổi"|r_12=="Trẻ"|r_12=="Tuổi"|r_13=="Trẻ"|r_13=="Tuổi"|r_14=="Trẻ"|r_14=="Tuổi"|r_15=="Trẻ"|r_15=="Tuổi";

replace d102_youth=1 if r_1=="trẻ"|r_1=="tuổi"|r_2=="trẻ"|r_2=="tuổi"|r_3=="trẻ"|r_3=="tuổi"|r_4=="trẻ"|r_4=="tuổi"|r_5=="trẻ"|r_5=="tuổi"|
r_6=="trẻ"|r_6=="tuổi"|r_7=="trẻ"|r_7=="tuổi"|r_8=="trẻ"|r_8=="tuổi"|r_9=="trẻ"|r_9=="tuổi"|r_10=="trẻ"|r_10=="tuổi"|
r_11=="trẻ"|r_11=="tuổi"|r_12=="trẻ"|r_12=="tuổi"|r_13=="trẻ"|r_13=="tuổi"|r_14=="trẻ"|r_14=="tuổi"|r_15=="trẻ"|r_15=="tuổi";


replace d102_youth=0 if d102_youth==.;
lab var d102_youth "They are young";

#delimit;
generate d102_female=1 if r_1=="nu"|r_1=="nu"|r_2=="nu"|r_2=="nu"|r_3=="nu"|r_3=="nu"|r_4=="nu"|r_4=="nu"|r_5=="nu"|r_5=="nu"|
r_6=="nu"|r_6=="nu"|r_7=="nu"|r_7=="nu"|r_8=="nu"|r_8=="nu"|r_9=="nu"|r_9=="nu"|r_10=="nu"|r_10=="nu"|
r_11=="nu"|r_11=="nu"|r_12=="nu"|r_12=="nu"|r_13=="nu"|r_13=="nu"|r_14=="nu"|r_14=="nu"|r_15=="nu"|r_15=="nu";
replace d102_female=0 if d102_female==.;
lab var d102_female "They are female";

#delimit;
generate d102_male=1 if r_1=="nam"|r_1=="nam"|r_2=="nam"|r_2=="nam"|r_3=="nam"|r_3=="nam"|r_4=="nam"|r_4=="nam"|r_5=="nam"|r_5=="nam"|
r_6=="nam"|r_6=="nam"|r_7=="nam"|r_7=="nam"|r_8=="nam"|r_8=="nam"|r_9=="nam"|r_9=="nam"|r_10=="nam"|r_10=="nam"|
r_11=="nam"|r_11=="nam"|r_12=="nam"|r_12=="nam"|r_13=="nam"|r_13=="nam"|r_14=="nam"|r_14=="nam"|r_15=="nam"|r_15=="nam";
replace d102_male=1 if r_1=="dan ong"|r_1=="dan ong"|r_2=="dan ong"|r_2=="dan ong"|r_3=="dan ong"|r_3=="dan ong"|r_4=="dan ong"|r_4=="dan ong"|r_5=="dan ong"|r_5=="dan ong"|r_6=="dan ong"|r_6=="dan ong"|r_7=="dan ong"|r_7=="dan ong"|r_8=="dan ong"|r_8=="dan ong"|r_9=="dan ong"|r_9=="dan ong"|r_10=="dan ong"|r_10=="dan ong"|r_11=="dan ong"|r_11=="dan ong"|r_12=="dan ong"|r_12=="dan ong"|r_13=="dan ong"|r_13=="dan ong"|r_14=="dan ong"|r_14=="dan ong"|r_15=="dan ong"|r_15=="dan ong";
replace d102_male=1 if r_1=="Dan ong"|r_1=="Dan ong"|r_2=="Dan ong"|r_2=="Dan ong"|r_3=="Dan ong"|r_3=="Dan ong"|r_4=="Dan ong"|r_4=="Dan ong"|r_5=="Dan ong"|r_5=="Dan ong"|r_6=="Dan ong"|r_6=="Dan ong"|r_7=="Dan ong"|r_7=="Dan ong"|r_8=="Dan ong"|r_8=="Dan ong"|r_9=="Dan ong"|r_9=="Dan ong"|r_10=="Dan ong"|r_10=="Dan ong"|r_11=="Dan ong"|r_11=="Dan ong"|r_12=="Dan ong"|r_12=="Dan ong"|r_13=="Dan ong"|r_13=="Dan ong"|r_14=="Dan ong"|r_14=="Dan ong"|r_15=="Dan ong"|r_15=="Dan ong";
replace d102_male=1 if r_1=="Dan Ong"|r_1=="Dan Ong"|r_2=="Dan Ong"|r_2=="Dan Ong"|r_3=="Dan Ong"|r_3=="Dan Ong"|r_4=="Dan Ong"|r_4=="Dan Ong"|r_5=="Dan Ong"|r_5=="Dan Ong"|r_6=="Dan Ong"|r_6=="Dan Ong"|r_7=="Dan Ong"|r_7=="Dan Ong"|r_8=="Dan Ong"|r_8=="Dan Ong"|r_9=="Dan Ong"|r_9=="Dan Ong"|r_10=="Dan Ong"|r_10=="Dan Ong"|r_11=="Dan Ong"|r_11=="Dan Ong"|r_12=="Dan Ong"|r_12=="Dan Ong"|r_13=="Dan Ong"|r_13=="Dan Ong"|r_14=="Dan Ong"|r_14=="Dan Ong"|r_15=="Dan Ong"|r_15=="Dan Ong";
replace d102_male=1 if r_1=="NAM""|r_1=="NAM""|r_2=="NAM""|r_2=="NAM""|r_3=="NAM""|r_3=="NAM""|r_4=="NAM""|r_4=="NAM""|r_5=="NAM""|r_5=="NAM""|r_6=="NAM""|r_6=="NAM""|r_7=="NAM""|r_7=="NAM""|r_8=="NAM""|r_8=="NAM""|r_9=="NAM""|r_9=="NAM""|r_10=="NAM""|r_10=="NAM""|r_11=="NAM""|r_11=="NAM""|r_12=="NAM""|r_12=="NAM""|r_13=="NAM""|r_13=="NAM""|r_14=="NAM""|r_14=="NAM""|r_15=="NAM""|r_15=="NAM"";
replace d102_male=0 if d102_male==.;
lab var d102_male "They are male";


#delimit;
generate d102_quality=1 if r_1=="gioi"|r_1=="gioi"|r_2=="gioi"|r_2=="gioi"|r_3=="gioi"|r_3=="gioi"|r_4=="gioi"|r_4=="gioi"|r_5=="gioi"|r_5=="gioi"|
r_6=="gioi"|r_6=="gioi"|r_7=="gioi"|r_7=="gioi"|r_8=="gioi"|r_8=="gioi"|r_9=="gioi"|r_9=="gioi"|r_10=="gioi"|r_10=="gioi"|
r_11=="gioi"|r_11=="gioi"|r_12=="gioi"|r_12=="gioi"|r_13=="gioi"|r_13=="gioi"|r_14=="gioi"|r_14=="gioi"|r_15=="gioi"|r_15=="gioi";
replace d102_quality=1 if r_1=="Gioi"|r_1=="Gioi"|r_2=="Gioi"|r_2=="Gioi"|r_3=="Gioi"|r_3=="Gioi"|r_4=="Gioi"|r_4=="Gioi"|r_5=="Gioi"|r_5=="Gioi"|
r_6=="Gioi"|r_6=="Gioi"|r_7=="Gioi"|r_7=="Gioi"|r_8=="Gioi"|r_8=="Gioi"|r_9=="Gioi"|r_9=="Gioi"|r_10=="Gioi"|r_10=="Gioi"|
r_11=="Gioi"|r_11=="Gioi"|r_12=="Gioi"|r_12=="Gioi"|r_13=="Gioi"|r_13=="Gioi"|r_14=="Gioi"|r_14=="Gioi"|r_15=="Gioi"|r_15=="Gioi";
replace d102_quality=1 if r_1=="Tot"|r_1=="Tot"|r_2=="Tot"|r_2=="Tot"|r_3=="Tot"|r_3=="Tot"|r_4=="Tot"|r_4=="Tot"|r_5=="Tot"|r_5=="Tot"|
r_6=="Tot"|r_6=="Tot"|r_7=="Tot"|r_7=="Tot"|r_8=="Tot"|r_8=="Tot"|r_9=="Tot"|r_9=="Tot"|r_10=="Tot"|r_10=="Tot"|
r_11=="Tot"|r_11=="Tot"|r_12=="Tot"|r_12=="Tot"|r_13=="Tot"|r_13=="Tot"|r_14=="Tot"|r_14=="Tot"|r_15=="Tot"|r_15=="Tot";
replace d102_quality=1 if r_1=="tot"|r_1=="tot"|r_2=="tot"|r_2=="tot"|r_3=="tot"|r_3=="tot"|r_4=="tot"|r_4=="tot"|r_5=="tot"|r_5=="tot"|
r_6=="tot"|r_6=="tot"|r_7=="tot"|r_7=="tot"|r_8=="tot"|r_8=="tot"|r_9=="tot"|r_9=="tot"|r_10=="tot"|r_10=="tot"|
r_11=="tot"|r_11=="tot"|r_12=="tot"|r_12=="tot"|r_13=="tot"|r_13=="tot"|r_14=="tot"|r_14=="tot"|r_15=="tot"|r_15=="tot";
replace d102_quality=1 if r_1=="Co" & r_2=="nang";
replace d102_quality=1 if r_1=="Nang" & r_2=="luc";
replace d102_quality=0 if d102_quality==.;
lab var d102_quality "They are high quality";


#delimit;
generate d102_selfnom=1 if r_1=="Tu" & r_2=="ung" & r_3=="cu";
replace d102_selfnom=1 if  r_1=="Tu" & r_2=="ung" & r_3=="fu";
replace d102_selfnom=1 if  r_1=="Tu" & r_2=="ung" & r_4=="cu";
replace d102_selfnom=1 if  r_3=="tu" & r_4=="ung" & r_5=="cu";
replace d102_selfnom=0 if d102_selfnom==.;
lab var d102_quality "They are self nominated";

#delimit;
generate d102_province=1 if r_1=="Cung" & r_2=="que";
replace d102_province=1 if r_1=="Cung" & r_2=="Tinh";
replace d102_province=1 if r_1=="Cung" & r_2=="tinh";
replace d102_province=1 if r_1=="Cung" & r_2=="dia";
replace d102_province=1 if r_1=="Den";
replace d102_province=1 if d102_1_ot=="Dan binh duong";
replace d102_province=1 if r_1=="Do" & r_2=="cung";
replace d102_province=1 if r_1=="Do" & r_2=="nguoi";
replace d102_province=1 if d102_1_ot=="Ho o hoa binh";
replace d102_province=1 if r_1=="La" & r_2=="nguoi";
replace d102_province=1 if r_3=="la" & r_4=="nguoi";
replace d102_province=1 if d102_1_ot=="Nguoi dia phuong";
replace d102_province=1 if r_1=="Nguoi" & r_2=="do"; 
replace d102_province=1 if r_1=="Đồng" & r_2=="huong"; 
replace d102_province=1 if r_1=="Que"; 
replace d102_province=1 if r_1=="O"; 
replace d102_province=0 if d102_province==.;
lab var d102_province "They are from my province";


#delimit;
generate d102_biz=1 if r_1=="doanh"|r_1=="doanh"|r_2=="doanh"|r_2=="doanh"|r_3=="doanh"|r_3=="doanh"|r_4=="doanh"|r_4=="doanh"|r_5=="doanh"|r_5=="doanh"|
r_6=="doanh"|r_6=="doanh"|r_7=="doanh"|r_7=="doanh"|r_8=="doanh"|r_8=="doanh"|r_9=="doanh"|r_9=="doanh"|r_10=="doanh"|r_10=="doanh"|
r_11=="doanh"|r_11=="doanh"|r_12=="doanh"|r_12=="doanh"|r_13=="doanh"|r_13=="doanh"|r_14=="doanh"|r_14=="doanh"|r_15=="doanh"|r_15=="doanh";
replace d102_biz=1 if r_1=="Doanh"|r_1=="Doanh"|r_2=="Doanh"|r_2=="Doanh"|r_3=="Doanh"|r_3=="Doanh"|r_4=="Doanh"|r_4=="Doanh"|r_5=="Doanh"|r_5=="Doanh"|
r_6=="Doanh"|r_6=="Doanh"|r_7=="Doanh"|r_7=="Doanh"|r_8=="Doanh"|r_8=="Doanh"|r_9=="Doanh"|r_9=="Doanh"|r_10=="Doanh"|r_10=="Doanh"|
r_11=="Doanh"|r_11=="Doanh"|r_12=="Doanh"|r_12=="Doanh"|r_13=="Doanh"|r_13=="Doanh"|r_14=="Doanh"|r_14=="Doanh"|r_15=="Doanh"|r_15=="Doanh";
replace d102_biz=0 if d102_biz==.;
lab var d102_biz "They are biz";
tab d102_biz;

#delimit;
generate d102_job=1 if r_1=="Nghe" & r_2=="nghiep";
replace d102_job=1 if r_3=="Nghe" & r_4=="nghiep";
replace d102_job=1 if r_1=="nghe" & r_2=="nghiep";
replace d102_job=1 if r_3=="nghe" & r_4=="nghiep";
replace d102_job=0 if d102_job==.;
tab d102_job;


#delimit;
generate d102_experience=1 if r_1=="Co" & r_2=="kinh" & r_3=="nghiem";
replace d102_experience=0 if d102_experience==.;
tab d102_experience;


#delimit;
generate d102_education=1 if r_1=="Co" & r_2=="hoc";
replace d102_education=1 if r_1=="Hoc";
replace d102_education=1 if r_1=="hoc";
replace d102_education=1 if r_1=="Trinh" & r_2=="do";
replace d102_education=1 if r_1=="trinh" & r_2=="do";
replace d102_education=0 if d102_education==.;
tab d102_education;


#delimit;
reg d102_party i.no_policy##i.treatment_experience if year==2018;
reg d102_party i.no_policy##i.treatment_experience if year==2018 & d101d5b==1;
reg d102_party i.no_policy##i.treatment_experience if year==2018 & d101d5b==1 & d102_1_ot !="";


codebook d102_1;


gen d102_1_new = .;
replace d102_1_new=16 if d102_1==7 & year==2018; /*Other*/
replace d102_1_new=1 if d102_party==1 & year==2018;
replace d102_1_new=2 if d102_1==8 & year==2018; /*Policies Match*/
replace d102_1_new=3 if d102_1==2 & year==2018; /*experience*/
replace d102_1_new=3 if d102_experience==2 & year==2018; /*experience*/
replace d102_1_new=4 if d102_1==3 & year==2018;  /*leadership*/ 
replace d102_1_new=5 if d102_education==1 & year==2018; /*Education*/ 
replace d102_1_new=5 if d102_1==4 & year==2018; /*Education*/ 
replace d102_1_new=6 if d102_1==1 & year==2018;/*Locality*/ 
replace d102_1_new=7 if d102_1==6 & year==2018; /*Work in System*/
replace d102_1_new=8 if d102_female==1 & year==2018; /*Female*/
replace d102_1_new=9 if d102_male==1 & year==2018;  /*Male*/
replace d102_1_new=10 if d102_selfnom==1 & year==2018; /*Self-Nom*/
replace d102_1_new=11 if d102_biz==1 & year==2018; /*Entrepreneur*/
replace d102_1_new=12 if d102_quality==1 & year==2018; /*High Quality*/
replace d102_1_new=13 if d102_youth==1 & year==2018; /*Youth*/
replace d102_1_new=14 if d102_job==1 & year==2018; /*Job*/
replace d102_1_new=15 if d102_1==5 & year==2018; /*No Change*/




label values d102_1_new reasons;
label define reasons 1 "Party Member"  2 "Policies Match" 3 "Experience" 4 "Leadership" 5 "Education" 6 "Represent Locality"  7 "Works w/in System" 8 "Female" 9 "Male"  10 "Self-Nominee" 11 "Entrepreneur" 12 "High Quality" 13 "Youth" 14 "Career" 15 "No Change" 16 "Other";
tab d102_1_new if year==2018, missing;
tab d102_1_new if d102_1==16;


#delimit;
graph hbar, over(d102_1_new) bar(1, fcolor(navy)) blabel(bar, size(small) position(Outside) format(%3.1f)) scheme(s1color) ytitle("Percentage of Respondents (%)", size(medium) margin(medium)) ylab(0(2)22, labsize(small)) title("All");
graph save "Figures\text_all.gph", replace;


#delimit;
graph hbar if d101d5b==0, over(d102_1_new) bar(1, fcolor(navy)) blabel(bar, size(small) position(Outside) format(%3.1f)) scheme(s1color) ytitle("Percentage of Respondents (%)", size(medium) margin(medium)) ylab(0(2)22, labsize(small)) title("Others");
graph save "Figures\text_f.gph", replace;

#delimit;
graph hbar if d101d5b==1, over(d102_1_new) bar(1, fcolor(navy)) blabel(bar, size(small) position(Outside) format(%3.1f)) scheme(s1color) ytitle("Percentage of Respondents (%)", size(medium) margin(medium)) ylab(0(2)22, labsize(small)) title("Non-Falsifiers");
graph save "Figures\text_nf.gph", replace;

#delimit;
graph combine "Figures\text_f.gph" "Figures\text_nf.gph", xcommon ycommon imargin(tiny) cols(2) scheme(s1color) note("Note: Response to question about why respondent chose the candidate", size(vsmall));
graph save "Figures\Figure6_text.gph",  replace;

#delimit;
xi: svy: reg d102_party i.no_policy*i.treatment_experience if year==2018;
outreg2 using "Tables\text", tdec(3) bdec(3) e(Xmfx_y F N_strata N_psu N_poststrata)  replace;
xi: svy: reg d102_party i.no_policy*i.treatment_experience if year==2018 & d102_1_ot !="";
outreg2 using "Tables\text", tdec(3) bdec(3) e(Xmfx_y F N_strata N_psu N_poststrata);
xi: svy: reg d102_party i.no_policy*i.treatment_experience if year==2018 & d101d5b==1;
outreg2 using "Tables\text", tdec(3) bdec(3) e(Xmfx_y F N_strata N_psu N_poststrata);
xi: svy: reg d102_party i.no_policy*i.treatment_experience if year==2018 & d101d5b==1 & d102_1_ot !=""; 
outreg2 using "Tables\text", tdec(3) bdec(3) e(Xmfx_y F N_strata N_psu N_poststrata);
xi: svy: reg d102_party i.no_policy*i.treatment_experience if year==2018 & d101d5b==0;
outreg2 using "Tables\text", tdec(3) bdec(3) e(Xmfx_y F N_strata N_psu N_poststrata);
xi: svy: reg d102_party i.no_policy*i.treatment_experience if year==2018 & d101d5b==0 & d102_1_ot !="";
outreg2 using "Tables\text", tdec(3) bdec(3) e(Xmfx_y F N_strata N_psu N_poststrata) excel;


#delimit;
svy: reg d102_party i.no_policy##i.treatment_experience if year==2018 & d101d5b==1 & d102_1_ot !="";
margins i.no_policy##i.treatment_experience;


#delimit;
svy: reg d102_party i.no_policy##i.treatment_experience if year==2018 & d101d5b==0 & d102_1_ot !="";
margins i.no_policy##i.treatment_experience;

